package com.lrkj.back.service.impl;

import java.util.List;
import java.util.Map;

import com.lrkj.back.entity.ZsMiejunMingxi;
import com.lrkj.back.mapper.ZsMiejunMingxiMapper;
import com.lrkj.back.service.ZsMIejunMingxiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.cbons.mamisay.parent.db.api.DBInterface;
import cn.com.cbons.mamisay.parent.exception.DBException;
import cn.com.cbons.mamisay.parent.service.base.ParentServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Transactional
@Service("miejunmingxiservice")
public class ZsMiejunMingxiServiceImpl extends ParentServiceImpl<ZsMiejunMingxi> implements ZsMIejunMingxiService {

    @Autowired
    private ZsMiejunMingxiMapper zsMiejunMingxiMapper;

    @Override
    public PageInfo<ZsMiejunMingxi> findAllMiejunMingxi(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<ZsMiejunMingxi> tbList = zsMiejunMingxiMapper.findAllMiejunMingxi(map);
        PageInfo<ZsMiejunMingxi> page = new PageInfo<ZsMiejunMingxi>(tbList);
        return page;
    }

    @Override
    protected DBInterface<ZsMiejunMingxi> getDao() throws DBException {
        return zsMiejunMingxiMapper;
    }

    @Override
    public void updateEndTimeAndHege(Map<String, Object> map) throws DBException {
        zsMiejunMingxiMapper.updateEndTimeAndHege(map);
    }

    @Override
    public void updateRecordtime(Map<String, Object> map) throws DBException {
        zsMiejunMingxiMapper.updateRecordtime(map);
    }

    @Override
    public List<ZsMiejunMingxi> findWaitShenhe(Map<String, Object> map) throws DBException {
        return zsMiejunMingxiMapper.findWaitShenhe(map);
    }

    @Override
    public int insertBatch(List<ZsMiejunMingxi> list) throws DBException {
        return zsMiejunMingxiMapper.insertBatch(list);
    }

}
